from kafka import *

producer = KafkaProducer(bootstrap_servers=['master:9092'])

message = producer.send('testPython', b'raw_bytes')
print("发送成功！")
producer.flush()
producer.close()